import moment from "moment"
import "moment/locale/zh-cn"
moment.locale("zh-cn")
moment.suppressDeprecationWarnings = true
// 带时间日期格式化
const dateTime = (val, pattern = "YYYY-MM-DD HH:mm:ss") => {
	return moment(val).format(pattern) || "-"
}
// 日期格式化
const date = (val, pattern = "YYYY-MM-DD") => {
	return moment(val).format(pattern) || "-"
}
// 时间格式化
const time = (val, pattern = "HH:mm:ss") => {
	return moment(val).format(pattern) || "-"
}
export default { dateTime, date, time }
